package cate.game.pvp.guildwar;

import cate.game.GameBody;
import cate.game.framework.ModuleMan;
import cate.game.pvp.guildwar.data.GWGameMessagingModule;
import easy.java.dev.note.NoteClass;
import lombok.Getter;

@NoteClass("游戏服公会战管理")
@Getter
public class GuildWarManager extends ModuleMan {

    public static final String MODULE_NAME = "guild_war";

    private final GWDataManager dataManager = new GWDataManager();
    private final GWGameMessagingModule messagingModule = new GWGameMessagingModule();
    private final GWGameReceiveModule notificationModule = new GWGameReceiveModule();

    @Override
    public void initIndependent(GameBody game) throws Exception {
        super.initIndependent(game);
        this.dataManager.initIndependent(game);
        this.notificationModule.initIndependent(game);
        this.messagingModule.initIndependent(game);
    }

    @Override
    public void initDependent() throws Exception {
        this.dataManager.initDependent();
        this.notificationModule.initDependent();
        this.messagingModule.initDependent();
    }

    public void tick(){
        dataManager.tick();
    }

    @Override
    public void onDaySpan() {
        dataManager.onDaySpan();
    }

    @Override
    public void shutdown() {
        super.shutdown();
        this.dataManager.shutdown();
    }
}
